x86/mm: Disable paging_prep
authorAndres Lagar-Cavilla <andres@lagarcavilla.org>
Thu, 12 Jan 2012 10:52:30 +0000 (10:52 +0000)
committerAndres Lagar-Cavilla <andres@lagarcavilla.org>
Thu, 12 Jan 2012 10:52:30 +0000 (10:52 +0000)
The only way to page-in a page is now the safe paging_load domctl.
(Unless the page was never paged out in the first place)

Signed-off-by: Andres Lagar-Cavilla <andres@lagarcavilla.org>
Acked-by: Tim Deegan <tim@xen.org>
Committed-by: Tim Deegan <tim@xen.org>
xen/arch/x86/mm/p2m.c

index e37a1fe0f13fc0437f2eed67327ad6450c7cc10c..6a1cad08bc447b991f7b07d0ca04212c04a85ea0 100644 (file)
@@ -989,6 +989,10 @@ int p2m_mem_paging_prep(struct domain *d, unsigned long gfn, uint64_t buffer)
     /* Allocate a page if the gfn does not have one yet */
     if ( !mfn_valid(mfn) )
     {
+        /* If the user did not provide a buffer, we disallow */
+        ret = -EINVAL;
+        if ( unlikely(user_ptr == NULL) )
+            goto out;
         /* Get a free page */
         ret = -ENOMEM;
         page = alloc_domheap_page(p2m->domain, 0);